package com.e3roid.examples;

import com.e3roid.E3Activity;
import com.e3roid.E3Engine;
import com.e3roid.E3Scene;
import com.e3roid.drawable.texture.TiledTexture;
import com.e3roid.drawable.Background;
import com.e3roid.util.Debug;

public class BackgroundExample extends E3Activity {

	private final static int WIDTH  = 320;
	private final static int HEIGHT = 480;
	
	@Override
	public E3Engine onLoadEngine() {
		E3Engine engine = new E3Engine(this, WIDTH, HEIGHT);
		engine.requestFullScreen();
		engine.requestPortrait();
		return engine;
	}

	@Override
	public E3Scene onLoadScene() {
		E3Scene scene = new E3Scene();
		// Use Background class to set the sprite background.
		// If you want to fill background with static color,
		// use scene.setBackgroundColor(red, green, blue, alpha) instead.
		Background background = new Background(
				new TiledTexture("background.png", getWidth(), getHeight(), this));
		scene.getTopLayer().setBackground(background);
		return scene;
	}

	@Override
	public void onLoadResources() {
		Debug.d("onLoadResource");
	}

}